#pragma once
#include "../../test_type.h"
#include "../../../src/socket/TcpIoSocket.h"
#include "../../../src/stream/SocketIoBuffer.h"
#include "../../../src/socket/TcpIoClient.h"
#include <iostream>

namespace client
{
	using namespace std;
	using namespace LibTools;
	class SessionClient
	{
	public:
		SessionClient();
		~SessionClient();

		void Start();

		void SetTcpServer(CTcpIoClient* server);

		CTcpIoClient* GetTcpServer();

		static DWORD HandleWrite(char* data, DWORD dwSize, CSockError ec, void* invoker);

		static DWORD HandleRead(char* data, DWORD dwSize, CSockError ec, void* invoker);

	public:
		CSocketIoBuffer _readbuff;
		CSocketIoBuffer _writebuff;
		CTcpIoSocket _sock;
		CTcpIoClient *_server;
	};
}
